home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / dev / amos / multiwindows.lha / MultiWindows / WinTech.TXT < prev   
Text File  |  1999-01-04  |  7KB  |  218 lines

  1. Multiwindows Documentation thingy.
  2.  
  3. This is just a gathering of all the information I have about these Amos 
  4. interface systems. I wasn`t going to write this, but decided that the 
  5. programs were too complicated to leave out at least some documentation. 
  6. Knowledge of the arrays is essential if you want to write anything slightly 
  7. complicated for Multiwindows.
  8.  
  9. I wrote the whole thing for fun - I don't know how well it works, but 
  10. feel free to email me if you want help or anything. The windows system 
  11. was a bit of a disappointment, as it tends to slow down rapidly, and takes 
  12. a lot of ram. At least the gadgets are stil responsive, though. You`ve got 
  13. to admit that custon windows are a bit cool!
  14.  
  15. I've moved on to c coding now, mostly using windoze/linux, but I've yet to 
  16. code anything good in it :)
  17.  
  18. Multiwindows gadgets are just an extension of AGads, which moves the gadget 
  19. zones onto moveable windows. It's pretty much a kludge, but I've put in a 
  20. few neat algorithmic optimizations to speed it up - no code optimizing 
  21. though :(
  22.  
  23.  
  24. Ok, some features :
  25.  
  26.  - Nice, professional looking interface - much nicer than that Amos 
  27.    pro effort :)
  28.  
  29.  - Buttons, textboxes, sliders, checkboxes, radio gadgets, requesters
  30.    and a file selector
  31.  
  32.  - Completely free and unrestricted - treat the code as if it were your
  33.    own ( you might try not taking all the credit for it though :)
  34.  
  35.  
  36. The technical details:
  37. ----------------------
  38.  
  39. First of all, when opening windows or gadgets, don't use number 0, since 
  40. I probably use that for some global things, and it could really foul up!
  41.  
  42. Also, use set buffer to increase the variable buffer space, as the interface 
  43. is pretty variable hungry :)
  44. Use the free command to find out how much free buffer space there is, and 
  45. set the buffer to an appropriate value.
  46.  
  47. Set GADCOUNT and WINCOUNT to the number you are going to use. GADCOUNT means 
  48. number of gadgets PER WINDOW!
  49.  
  50. Remember the first four gadgets on each window are close, depth, size, drag. 
  51. Creating a textbox as gadget no 4 will act as a drag bar. Your buttons can 
  52. start at number 5.
  53. As a consequence, GADCOUNT must be 4 or above.
  54.  
  55. The last window is reserved for the fileselector/requester, so don't use it 
  56. if you intend to use these procedures!
  57.  
  58. The global variable WINCLOSED is normally zero, but if a close gadget is 
  59. clicked, it will be the window number to be closed.
  60. The same is true for WINSIZED. If a window is to be resized, 
  61. the new dimensions should be determined, the graphics redrawn, and the 
  62. gadgets moved/sized.
  63.  
  64. After 1 loop of WINSCAN[], WINCLOSED and WINSIZED are reset to zero so as 
  65. not to confuse things.
  66. The Procedures
  67. --------------
  68.  
  69. WIN_SETCOLOURS[black,white,grey,blue,darkgrey]
  70.  
  71.    Sets the palette indexes for the interface. If using a 4 colour
  72.    screen, let darkgrey=grey.
  73.  
  74.    Colour values are stored in the global variables vblue,vdgrey etc.
  75.  
  76. WIN_SETUP[screen]
  77.  
  78.    Call this after opening screens and setting up colours. 2 screens are 
  79.    used, the one specified by screen and the one after it, screen+1. The
  80.    2nd screen is a double buffer and must be out of sight.
  81.    ** Always bring the first screen to the front **.
  82.  
  83. WIN_CREATE[Number,x,y,xsize,ysize,min-xsize,min-ysize,max-xsize,max-ysize]
  84.  
  85.    Creates a window area at the specified coordinates. Resize limits
  86.    should also be given even if you do not intend the window to be
  87.    sizeable - just to be on the safe side :)
  88.  
  89. WINTOFRONT[number]
  90.  
  91.    Brings a window to the front. You must do this before changing the
  92.    graphics in a window, or the changes won't be stored properly!
  93.  
  94.    To draw in a window, simply bring it to the front and place graphics
  95.    in it's screen area. The changes are stored when you drag the window
  96.    or bring another one to the front.
  97.  
  98. WIN_FRAMEWORK[number,type,pattern,patterncolour1,patterncolour2,title$]
  99.  
  100.    Draws a framework on a window with some options, such as a pattern,
  101.    and can also create gadgets such as a dragbar, close, size, and depth.
  102.  
  103.    To use this, you must first create a window with WIN_CREATE[].
  104.  
  105.    type has 3 options : 1 - Depth gadget and dragbar
  106.                         2 - Depth, drag, close
  107.                         3 - Depth, drag, close, size
  108.  
  109.    pattern is the same as the number used in the Set Pattern command,
  110.    and the two colors are those to be used in the pattern. Experiment!
  111.  
  112.    ** You don't have to use this command to draw window graphics - you
  113.       can set the zones yourself, using WIN_SET_ZONE[], or
  114.       GAD_SBUT_CREATE[], and draw any graphics you want in them. The
  115.       gadgets can be anywhere you want - a window with a dragbar at the
  116.       side is pretty cool stuff :)
  117.  
  118.       The close gadget has to be plain though, but a little
  119.       reprogramming can sort that out!
  120.  
  121. WINTOBACK[number]
  122.  
  123.    Sends the specified window to the back. Like pressing depth gadget.
  124.  
  125. WIN_CLOSE[number]
  126.  
  127.    Erases the specified window, and deletes it from the screen. You
  128.    can't get it back once deleted - you must recreate the window and
  129.    recreate the gadgets.
  130.  
  131. WIN_SETGFX[number]
  132.  
  133.    Copies the contents of the screen occupied by a window to the
  134.    window's own gfx buffer.
  135.    The window must be at the front for this to work properly. Use
  136.    WINSELECTED to determine which window is at the front.
  137.  
  138.    You should never need to use this procedure - it is handled
  139.    automatically.
  140.  
  141. WINDRAG[number]
  142.  
  143.    Have a guess - this is called automatically in winscan, so you should
  144.    never have to call it yourself.
  145.  
  146. WIN_SET_ZONE[winnum,gadnum,x,y,width,height]
  147.  
  148.    Defines a zone or gadget on a window. Co-ordinates are given as
  149.    window co-ordinates. ie) NOT SCREEN coordinates!! 
  150.    x=0,y=0 is the top left of the window, wherever it is.
  151.  
  152.    Using GAD_BUTTON_CREATE[] etc calls this procedure automatically, so
  153.    you may not have to use this procedure at all.
  154.  
  155.    You will need it for complicated programs such as painting programs
  156.    or spreadsheets etc.
  157.  
  158. WINSCAN[]
  159.  
  160.    This procedure MUST BE CALLED as part of an endless loop. It controls
  161.    the windowing system, and scans for mouse clicks etc.
  162.  
  163.    If a gadget or zone is clicked in a window, this procedure returns
  164.    the number in param. See the example program.
  165.  
  166.  
  167.  
  168. There are other window procedures, but they`re pretty low-level - and 
  169. they sort of document themselves.
  170.  
  171. See AGads2.1.doc for some documentation on the GAD procedures - they're 
  172. pretty straight forward. If you're not sure, (e)mail me or check the 
  173. RasterMaster1.6 source. There are some minor differences between the 
  174. multiwindows Agads and the standard ones. You can only create gadgets 
  175. on the foremost window, so bring it to the front if you haven't just 
  176. created it.
  177.  
  178. The Arrays
  179. ----------
  180.  
  181. WININFO(WINCOUNT,8)
  182.  
  183.  0 - True if window exists, else false.
  184.  1 - x  (top left)
  185.  2 - y
  186.  3 - x2 (bottom right)
  187.  4 - y2
  188.  5 - xsizemin
  189.  6 - ysizemin
  190.  7 - xsizemax
  191.  8 - ysizemax
  192.  
  193. WINORDER(WINCOUNT)
  194.  
  195.  1 - id of foremost window
  196.  2 - next one down ...
  197.  3 - etc
  198.  
  199. WINZONE(WINCOUNT,GADCOUNT,4)
  200.  
  201.  0 - Type of zone (different types for different gads)
  202.  1 - x
  203.  2 - y
  204.  3 - x2
  205.  4 - y2
  206.  
  207. Hope this helps ..
  208.  
  209. Martin Cameron
  210. 46 Ribby Road
  211. Kirkham
  212. PR4 2BA
  213. Lancs, UK
  214.  
  215. E-mail : M.D.Cameron@durham.ac.uk
  216.  
  217.  
  218. EndOfFile.